import { resultParser } from '../vul';

describe('resultParser', () => {
	test('field extract', () => {
		const result = resultParser({
			statistics: {},
			info: {},
			results: [
				{
					name: 'a',
					risk: '高',
					display_name: 'abc',
				},
			],
		});
		expect(result.warnings[0].title).toBe('abc');
		expect(result.warnings[0].level).toBe(3);
		expect(result.warnings[0].detail).toEqual({
			name: 'a',
			risk: '高',
			display_name: 'abc',
		});
	});
});
